#include <memory>
#include <functional>
#include "UDPClient.hpp"

std::unique_ptr<UDPClient> uc_ptr ;
//./UDPClient 127.0.0.1 8888
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        std::cerr << "Usage Error" << std::endl;
        exit(-1);
    }

    std::string ip = argv[1];
    uint16_t port = std::stoi(argv[2]);

    uc_ptr = std::make_unique<UDPClient>(port, ip);
    signal(2,[](int signo){
            uc_ptr->Quit(signo);
    });
    uc_ptr->Run();


    return 0;
}